package com.ts.content.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ts.content.entity.PostEntity;
import com.ts.content.vo.PostVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 帖子
 *
 * @author admin admin@qq.com
 * @since 1.0.0 2023-02-22
 */
@Mapper
public interface PostMapper extends BaseMapper<PostEntity> {
    public IPage<PostVo> getPostList(IPage<PostVo> page);

    void postSave(@Param("userId") Integer userId, @Param("classId") Integer classId, @Param("title") String title, @Param("content") String content, @Param("media") List media, @Param("discussList") List discussList, @Param("createTime") Date createTime);

    Page<PostEntity> getPostListByjoinTopic( IPage page,@Param("userId") Integer userId,@Param("order") Integer order);
}